<template>
    <div class="i-tip">
        {{ person?.name }}
    </div>
</template>

<script setup lang="ts">
import { inject } from "vue"
import {key,Person} from "./key";
const person = inject<Person>(key);
//子组件修改数据
if (person != undefined) {
    setTimeout(() => {
        person.name = "程序人生";
    }, 6000)
}
</script>
